// Lea - Guild Headquarters (mapid: 200000301)
// TODO: add option for removing emblem + add check if player has a guild

void npc(Player @player, NPC @npc) {
	int state = npc.getState();
	if(state == 0) { 
        npc.addText("A guild emblem costs 5 million mesos.");
        npc.sendYesNo(); 
	}
  	else if(state == 1) {
		if(npc.getSelected() == YES) {
			if(player.getMesos() >= 5000000){
				player.giveMesos(-5000000);
				npc.changeGuildEmblem();
                npc.end();
             } else {
                npc.addText("Are you sure you have enough mesos?");
                npc.sendOK();
                npc.end();
			}      
		} else {
			npc.end();
		}
	}
}